package com.app.entidades;

import com.example.applucianokikao.R;

import android.app.Activity;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

public class FaderEsq {

	  public static void runAlphaAnimation(Activity act, int viewId, int tipo) {
		  
	        //tipo=0 animação entrada
		  	//tipo=1 animação saida
		  Animation animation  = null;
		  if(tipo==0){
			  animation = AnimationUtils.loadAnimation(act, R.anim.translate_entrada_esq);
		  }else{
			  animation = AnimationUtils.loadAnimation(act, R.anim.translate_saida_esq);
		  }
	         
	        if(animation == null){
	        return; // here, we don't care
	        }
	        // reset initialization state
	        animation.reset();
	        // find View by its id attribute in the XML
	        View v = act.findViewById(viewId);
	        // cancel any pending animation and start this one
	        if (v != null){
	          v.clearAnimation();
	          v.startAnimation(animation);
	        }
	    }
}
